package name.jiaosha.air.user.domain;

import java.util.HashSet;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.ali8ba.Domain;

@Entity()
@Table(name = "login_user")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer" })
public class LoginUser extends Domain {
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String qq;
	private Boolean enabled;
	private String name;
	private String password;
	@JsonIgnore
	private java.util.Set<LoginLog> loginLogs = new HashSet<LoginLog>();

	public LoginUser() {
	}

	@Id()
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false, precision = 11)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Basic()
	@Column(name = "qq", unique = true, nullable = false, length = 20)
	public String getQq() {
		return this.qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	@Basic()
	@Column(name = "enabled", length = 1)
	public Boolean getEnabled() {
		return this.enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	@Basic()
	@Column(name = "name", length = 10)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Basic()
	@Column(name = "password", length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	// bi-directional many-to-one association to LoginLog
	@OneToMany(mappedBy = "loginUser",cascade={CascadeType.PERSIST}, fetch = FetchType.EAGER)
	public java.util.Set<LoginLog> getLoginLogs() {
		return this.loginLogs;
	}

	public void setLoginLogs(java.util.Set<LoginLog> loginLogs) {
		this.loginLogs = loginLogs;
	}

}